﻿using System.Collections;
using System.Collections.Generic;
using System;


namespace VFramework
{
	/// <summary>
	/// 参数组装器,链式主要一行代码创建dic
	/// 
	/// ArgsWarp.newWarp().put("x",1).put("y",1).toDic()
	/// </summary>
	public class ArgsWarp
	{
		private static Dictionary<object, object> _dic;
		private static ArgsWarp instance = null;


		public static ArgsWarp newWarp ()
		{
			_dic = new Dictionary<object, object> ();
			if (instance == null)
				instance = new ArgsWarp ();
			return instance;
		}

		public static object getValue (object key, object dic)
		{
			return ((Dictionary<object, object>)dic) [key];
		}

		public ArgsWarp put (object key, object value)
		{
			_dic.Add (key, value);
			return instance;
		}

		public Dictionary<object, object> toDic ()
		{
			return _dic;
		}


	}
}